<template>
	<view class="textblack14">
		<view v-if="isPc">
			<web-view src="http://47.122.46.76/"></web-view>
		</view>
		<view v-if="!isPc">
			<view class="lineGray marginTop"></view>
			<view v-show="notice.length>0" class="column bg-notice">
				<view class=" width100">
					<view class="padding">{{notice}}</view>
				</view>
				<view class="lineGray "></view>
			</view>

			<view class=" line textTab bold   ">
				<view @click="changeCategory(1)">
					<view :class="{textTab1:tabIndexCategory==1}" class="padding"><text>关注</text></view>
					<view v-show="tabIndexCategory==1" class="line-gray-large margin-left-right">
					</view>
				</view>
				<view @click="changeCategory(2)" class="marginLeft">
					<view :class="{textTab1:tabIndexCategory==2}" class="padding"><text>发现</text></view>
					<view v-show="tabIndexCategory==2" class="line-gray-large margin-left-right">
					</view>
				</view>
				<view @click="changeCategory(3)" class="marginLeft">
					<view :class="{textTab1:tabIndexCategory==3}" class="padding">设辑广场</view>
					<view v-show="tabIndexCategory==3" class="line-gray-large margin-left-right">
					</view>
				</view>
				<view @click="changeCategory(4)" class="marginLeft">
					<view :class="{textTab1:tabIndexCategory==4}" class="padding"><text>资讯</text></view>
					<view v-show="tabIndexCategory==4" class="line-gray-large margin-left-right">
					</view>
				</view>
				<view class="bigEmpty"></view>
			</view>
			<view class="lineGray marginTop"></view>

			<view v-show="tabIndexCategory==1" class="bgTab1">
				<!-- start 关注 -->
				<view class="line padding bgWhite">
					<view class="text-light-black-18">
						发现更多有趣的人
					</view>
					<view class="bigEmpty"></view>
					<image src="/static/refresh.png" class="icon-small" @click="changeNext()"></image>
					<view class="marginLeft text-light-2-black-16" @click="changeNext()">
						换一批
					</view>
				</view>
				<view v-for="(item,index) in userList" :key="index">
					<view class="padding">
						<view class="padding bgWhitecircleRect marginTop" @click="userCenter(item)">
							<view class="line">
								<image class="imageHead" :src="item.avator"></image>
								<view class="marginLeft">
									<view class="bold">{{item.name}}</view>
									<view class="margin-top-0">粉丝 {{item.fansNum}} 作品 {{item.productNum}}</view>
								</view>
								<view class="bigEmpty"></view>
								<view v-show="item.focused" class="btnBlue line textwhite8 " @click.stop="foucus(item)">
									已关注
								</view>
								<view v-show="!item.focused" class="btnBlue line textwhite8" @click.stop="foucus(item)">
									关注
								</view>
							</view>
							<view class="line marginTop">
								<view>
									<image class="imageWorks" :src="item.formatRecentPhoto[0]"></image>
									<view> </view>
								</view>

								<view class="bigEmpty"></view>
								<view class="marginLeft">
									<image class="imageWorks" :src="item.formatRecentPhoto[1]"></image>
									<view> </view>
								</view>
								<view class="bigEmpty"></view>
								<view class="marginLeft">
									<image class="imageWorks" :src="item.formatRecentPhoto[2]"></image>
									<view> </view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!-- end 关注 -->
			</view>

			<view v-show="tabIndexCategory==2" class="bgTab1">
				<!--  start 发现  -->
				<view class="padding">
					<view v-for="(item,index) in list3" :key="index" @click="postClick(item)">
						<view class="padding bgWhitecircleRect marginTop">
							<view class="line">
								<image class="imageHead" :src="item.user.avator"></image>
								<view class="marginLeft bold">{{item.user.name}}</view>
								<view class="marginLeft">{{item.createTime}}</view>
								<view class="bigEmpty"></view>
								<view class="btnBlue line textwhite8 marginLeft">关注</view>
							</view>
							<view class="line marginTop" style="width: 100% ;">
								<view style="width: 100% ;">
									<view style="width: 100% ;">
										<image mode="widthFix" class="imageWorks1 round" :src="item.formatImages[0]">
										</image>
									</view>
									<view> </view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!--  发现 关注 -->
			</view>
			<view v-show="tabIndexCategory==3">
				<!-- start 设辑广场 -->
				<view class="marginTop marginLeft marginRight" v-show="adList.length>0">
					<swiper :indicator-dots="adList.length!=1" indicator-active-color="#FFFFFF" circular autoplay
						:style="{'height': height}">
						<swiper-item v-for="(item ,index) in adList" :key="index">
							<image @click="adClick(item)" class="oneDom width100" mode="widthFix" :src="item.image"
								style="border-radius: 20rpx;" />
						</swiper-item>
					</swiper>
				</view>
				<view class=" line marginTop margin-left-right">
					<view class="bigEmpty" style="overflow: hidden;">
						<view scroll-x="false" class="scroll-view_H ">
							<view :class="{bgMoreColor:indexGroup==index,textWhite:indexGroup==index}"
								@click="changeGroup(index)" v-for="(item,index) in categoryList"
								class=" paddingSmall btnGray textblack8 marginRight scroll-view-item_H">
								&nbsp{{item.name}}&nbsp</view>
						</view>
					</view>
					<image class="icon-normal marginLeft" src="/static/more.png" @click="showMyDialog()"></image>
				</view>
				<view class="marginLeft lineStart marginTop " style="overflow: hidden;">
					<view v-for="(item,index) in userList" :key="index">
						<view class="column marginRight" @click="userCenter(item)">
							<view class="bgHead line">
								<view class="bgWhiteCircle line">
									<image class=" imageHead " :src="item.avator"></image>
								</view>
							</view>


							<view class=" textBlack12 margin-top-0 center-text ellipis-text-1" style="width: 105rpx; ">
								{{item.name}}
							</view>
						</view>
					</view>
				</view>
				<view class="lineGray marginTop"></view>
				<view class="line marginTop padding bold">
					<view class=" textblack14 ">
						<text :class="{textblue14:tabIndex==1}" @click="clickOption(1)">推荐</text>
						<text class="marginLeft " :class="{textblue14:tabIndex==2}" @click="clickOption(2)">最新</text>
						<!-- <text class="marginLeft " :class="{textblue14:tabIndex==3}" @click="clickOption(3)">同款</text> -->
						<text class="marginLeft " :class="{textblue14:tabIndex==3}" @click="clickOption(3)">点赞</text>
						<text class="marginLeft " :class="{textblue14:tabIndex==4}" @click="clickOption(4)">评论</text>
					</view>
					<view class="bigEmpty"></view>
					<view class="search line ">
						<view class="bigEmpty"><input class="marginLeft" v-model="nameKey" /></view>
						<view class="line height100 marginRight">
							<image class="icon-small " src="../../static/searchIcon.png" mode="widthFix"
								@click="search">
							</image>
						</view>
					</view>
				</view>
				<view class="line-no marginRight marginLeft">
					<view class="item-box bigEmpty column-start  ">
						<view v-for="(item,index) in data" :key="index" class=" bgWhitecircleRect marginBottom"
							@click="clickItem(item)">
							<div class="width100 ">
								<image mode="widthFix" class="itemCircle box-image" :src="item.formatImages[0]" />
							</div>
							<view class="box-bottom  line textwhite10 ">
								<view class="lineStart bg-black-circle-rect-transpart-1 margin sizeItemName"
									style="z-index: 100;">
									&nbsp;
									<image class="image-head-small " :src="item.user.avator" />
									&nbsp;
									<view style="z-index: 100;" class="margin-left-0 ellipis-text-1">{{item.user.name}}
									</view>&nbsp;
								</view>
								<view class="bigEmpty"></view>
								<view class="line bg-black-circle-rect-transpart-1 margin sizeHeigh25"
									@click.stop="love(item)" style="z-index: 100;">

									<view class="marginLeft">
										<image v-show="!item.loved" class="icon-normal " src="/static/love-white.png" />
										<image v-show="item.loved" class="icon-normal " src="/static/love-red.png" />
									</view>

									<view style="z-index: 100;" class="marginLeft marginRight">{{item.loveNum}}</view>

								</view>
							</view>
							<view class="marginTop text-light-black-10 margin-left-0 margin-right-0 ellipis-text-2"
								v-show="item.name">
								{{item.name}}
							</view>
						</view>
					</view>
					<view class="item-box bigEmpty column-start  marginLeft">
						<view v-for="(item,index) in data1" :key="index" class=" bgWhitecircleRect marginBottom"
							@click="clickItem(item)">
							<div class="width100 ">
								<image mode="widthFix" class="itemCircle box-image" :src="item.formatImages[0]" />
							</div>
							<view class="box-bottom  line textwhite10 ">
								<view class="lineStart bg-black-circle-rect-transpart-1 margin sizeItemName"
									style="z-index: 100;">
									&nbsp;
									<image class="image-head-small " :src="item.user.avator" />
									&nbsp;
									<view style="z-index: 100;" class="margin-left-0 ellipis-text-1">{{item.user.name}}
									</view>&nbsp;
								</view>
								<view class="bigEmpty"></view>
								<view class="line bg-black-circle-rect-transpart-1 margin sizeHeigh25"
									@click.stop="love(item)" style="z-index: 100;">

									<view class="marginLeft">
										<image v-show="!item.loved" class="icon-normal " src="/static/love-white.png" />
										<image v-show="item.loved" class="icon-normal " src="/static/love-red.png" />
									</view>

									<view style="z-index: 100;" class="marginLeft marginRight">{{item.loveNum}}</view>

								</view>
							</view>
							<view class="marginTop text-light-black-10 margin-left-0 margin-right-0 ellipis-text-2"
								v-show="item.name">
								{{item.name}}
							</view>
						</view>
					</view>
				</view>
				<!-- end 设辑广场 -->
			</view>
			<view v-show="tabIndexCategory==4" class="bgWhite">
				<!--  start 资讯  -->
				<view class="padding">
					<view v-for="(item,index) in informationList">
						<view class="column-start bg-gray-circle-rect marginBottom" @click="informationClick(item)">
							<image :src="item.image" class="image-width-100-top-circle" mode="widthFix"></image>
							<view class="padding">
								<view class="textblack18 bold">{{item.name}}</view>
								<view class="line text-light-black-18  marginTop ">
									<view class="bigEmpty">{{item.user.name}}</view>
									<view>{{item.user.createTime}}</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!--  end 资讯 -->
			</view>
			<view>
			</view>

			<view class="centerGroup dialogBg" style="z-index: 100000; " v-show="showDialog">
				<view class=" dialog-bottom-full-width padding">
					<view class="line textBlack18">
						<view class="bigEmpty marginLeft">全部频道</view>
						<view class="centerGroup marginRight textblack14" @click="canleDialog">X</view>
					</view>
					<view class="bigEmpty line-no marginLeft " style="z-index: 100000; flex-wrap: wrap;">
						<view :class="{bgMoreColor:indexGroup==index,textWhite:indexGroup==index}"
							@click="changeGroup(index)" v-for="(item,index) in categoryList"
							class=" paddingSmall btn-v30 btnGray textblack8 marginRight marginBottom line">
							&nbsp{{item.name}}&nbsp
						</view>
					</view>
					<view class="centerGroup marginTop">
					</view>
				</view>
			</view>

			<canvas canvas-id="mycanvas" style="  width: 320px;height: 0px; border: 0px red solid; "></canvas>
		</view>
	</view>
</template>

<script>
	import request from '/common/request.js';
	export default {
		data() {
			return {
				notice: "",
				nameKey: "",
				height: "0px",
				data1: [],
				data: [],
				loadMoreText: "加载中...",
				loading: false,
				adList: [],
				page: 0,
				page1: 1,
				loading3: false,
				page3: 0,
				list3: [],
				loading4: false,
				page4: 0,
				tabIndex: 2,
				tabIndexCategory: 3,
				indexGroup: 0,
				userList: [],
				informationList: [],
				categoryList: [{
					id: '',
					name: "全部"
				}],
				showDialog: false,
				writePhotosAlbum: undefined,
				isPc:false
			}
		},
		onShow: function() {
			this.noticeQuery()
			let that = this;
			// uni.getSetting({
			// 	success: res => {
			// 		that.writePhotosAlbum = res.authSetting["scope.writePhotosAlbum"];

			// 	}
			// })

		},
		onShareAppMessage(res) {
			return {
				title: '设辑-产品设计智能生成AI',
				path: '/pages/HomePage/HomePage',
				imageUrl: '/static/black-logo.png'
			}
		},
		// 自定义页面的分享到朋友圈
		onShareTimeline(res) {
			return {
				title: '设辑-产品设计智能生成AI',
				path: '/pages/HomePage/HomePage',
				imageUrl: '/static/black-logo.png'
			}
		},

		onReady: function() {
			var lovedCategory = uni.getStorageSync("lovedCategory");
			var category = uni.getStorageSync("category");
			if (this.categoryList.length == 1) {
				this.categoryList.push(...category)
			}
			this.requstCategoryData()
		},
		onLoad() {
			let self=this;
			uni.getSystemInfo({
				success: function (res) {
					console.log('getSystemInfo',res)
					if(res.platform=='windows'||res.platform=='mac'){
						self.isPc=true;
						uni.hideTabBar()
					}
				}
			});
			this.requstData()
			this.requstInformationData();
			this.requstPostData();
			this.queryUser();
			this.requstAdData()

		},
		onUnload() {

		},
		onReachBottom() {
			this.requstData();
		},
		onPullDownRefresh() {
			console.log('onPullDownRefresh');
			switch (tabIndexCategory) {
				case 1:

					break
				case 2:
					this.requstPostData();
					break
				case 3:
					this.requstData()
					break
				case 4:
					this.requstInformationData();
					break
			}
		},
		mounted() {
			// if (uni.getStorageSync('person-card')) {
			// 	this.canvasShow = false;
			// 	this.imgurl = uni.getStorageSync('person-card');
			// } else {
			this.canvasImage();
			// }
		},
		methods: {

			canvasImage() {
				// console.log('绘制');

				// let myCanvas = uni.createCanvasContext('mycanvas', this);
				// // 绘制背景
				// //myCanvas.drawImage("/static/qrcode.png", 90, 20, 140, 140);
				// //*******************************************************设置二维码大小就好了位置
				// // myCanvas.drawImage('/static/find.png', 185, 420, 375, 375);
				// let fontSize = 18;
				// myCanvas.font = `bold ${fontSize}px Arial`;


				// var margin = 20;
				// var padding = 20;
				// var width = 320;
				// var x = width / 2 - fontSize
				// var y = margin;

				// myCanvas.fillText('设辑', x, y);
				// x = 0
				// myCanvas.fillStyle = '#cccccc'; //填充线样式
				// y = margin + fontSize + 2;
				// myCanvas.fillRect(x, y, 320, 1);
				// x = margin
				// y = margin + fontSize + padding * 2;
				// myCanvas.fillStyle = '#cccccc';
				// myCanvas.fillText('关注', x, y);
				// x = margin + fontSize * 2 + padding;
				// myCanvas.fillText('发现', x, y);
				// x = margin + fontSize * 4 + padding * 2;
				// myCanvas.fillStyle = '#000000'; //填充线样式
				// myCanvas.fillText('设辑广场', x, y);
				// myCanvas.fillStyle = '#cccccc';

				// x = margin + fontSize * 8 + padding * 3;
				// myCanvas.fillText('资讯', x, y);
				// x = 0;
				// y = y + margin + 3;
				// myCanvas.fillRect(x, y, 320, 1);
				// fontSize = 12;
				// y = y + fontSize + margin;
				// x = 0;

				// var array = ["全部", "鞋样设计", "衣服设计"];
				// var strSize = 0;
				// for (var num = 0; num < array.length; num++) {
				// 	x = (num + 1) * margin + strSize * fontSize + num * padding / 2;
				// 	var str = array[num]
				// 	myCanvas.fillText(array[num], x, y);
				// 	strSize += array[num].length
				// }

				// myCanvas.draw(true, () => {
				// 	uni.canvasToTempFilePath({
				// 		canvasId: 'mycanvas',
				// 		success: res => {
				// 			///************************************************有个保存图片到本地的方法
				// 			this.imgurl = res.tempFilePath;
				// 			this.canvasShow = false;
				// 			uni.hideLoading();

				// 		},
				// 		fail: () => {
				// 			uni.showToast({
				// 				title: '名片加载失败',
				// 				duration: 2000
				// 			});
				// 		}
				// 	});
				// });
			},

			noticeQuery() {
				const that = this;
				const url = getApp().globalData.apiUrl + "/admin/v1/notice?type=3";
				request(url, "GET", {
						page: 0,
						size: 100
					}, "")
					.then(function(res) {

						var list = res.data;
						if (list.length > 0) {
							var notice = list[0];
							var name = notice.name;
							var content = notice.content;
							that.notice = name + "------" + content
						}

						console.log('返回正确回调', res)

					}, function(err) {
						console.log('返回错误回调', err)
					})
			},


			adClick(item) {
				if (item.pictureColledtionId)
					uni.navigateTo({
						url: "/pages/InformationDetail/InformationDetail?id=" + item.pictureColledtionId
					})
			},

			setH() {
				const that = this;

				setTimeout(() => {
						// uniapp自带方法 - 获取DOM的高度等信息
						// https://uniapp.dcloud.net.cn/api/ui/nodes-info.html#createselectorquery
						// 节点查询
						that.sethh();


					},
					300)
				setTimeout(() => {
					// uniapp自带方法 - 获取DOM的高度等信息
					// https://uniapp.dcloud.net.cn/api/ui/nodes-info.html#createselectorquery
					// 节点查询
					that.sethh();


				}, 600)
				setTimeout(() => {
					// uniapp自带方法 - 获取DOM的高度等信息
					// https://uniapp.dcloud.net.cn/api/ui/nodes-info.html#createselectorquery
					// 节点查询
					that.sethh();


				}, 1200)

				setTimeout(() => {
					// uniapp自带方法 - 获取DOM的高度等信息
					// https://uniapp.dcloud.net.cn/api/ui/nodes-info.html#createselectorquery
					// 节点查询
					that.sethh();


				}, 2000)
				setTimeout(() => {
					// uniapp自带方法 - 获取DOM的高度等信息
					// https://uniapp.dcloud.net.cn/api/ui/nodes-info.html#createselectorquery
					// 节点查询
					that.sethh();


				}, 5000)

			},
			sethh() {
				const that = this;
				const query = uni.createSelectorQuery().in(that)
				// 开始
				query.select('.oneDom').boundingClientRect(data => {
					console.log("【DOM尺寸信息】" + JSON.stringify(data))
					// 获取DOM的高度， 单位是像素
					let h = data.height
					// 补上单位
					h += 'px'
					// 实际高度赋值给swiper
					that.height = h
					console.log('【动态设置高度】', h)
				}).exec()
			},
			showMyDialog() {
				this.showDialog = true;
				uni.hideTabBar()
			},
			okDialog() {
				this.showDialog = false;
				uni.showTabBar()
			},
			canleDialog() {
				this.showDialog = false;
				uni.showTabBar()
			},
			requstCategoryData() {
				const that = this;
				const url = getApp().globalData.apiUrl + "/api/v1/category/all";
				request(url, "GET", {
						page: 0,
						size: 100
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调', res)
						uni.setStorageSync("category", res.data)
						var category = uni.getStorageSync("category");
						that.categoryList = [{
							id: '',
							name: "全部"
						}];
						if (that.categoryList.length == 1) {
							that.categoryList.push(...category)
						}
					}, function(err) {
						console.log('返回错误回调', err)
					})
			},
			postClick(item) {
				uni.navigateTo({
					url: "/pages/PictureDetail/PostDetail?id=" + item.id
				})
			},
			foucus(item) {
				if (item.focused) {
					const url = getApp().globalData.apiUrl + "/api/v1/user/deleteFocus";
					request(url, "DELETE", {
							focusUserId: item.id,
						}, uni.getStorageSync("token"))
						.then(function(res) {
							console.log('返回正确回调', res)
							item.focused = false
						}, function(err) {
							console.log('返回错误回调', err)
						})
				} else {
					const url = getApp().globalData.apiUrl + "/api/v1/user/focus";
					request(url, "POST", {
							focusUserId: item.id,
						}, uni.getStorageSync("token"))
						.then(function(res) {
							console.log('返回正确回调', res)
							item.focused = true
						}, function(err) {
							console.log('返回错误回调', err)
						})
				}
			},
			clickItem(item) {
				uni.navigateTo({
					url: "/pages/PictureDetail/PictureDetail?id=" + item.id
				})
			},
			love(item) {
				if (item.loved) {
					const url = getApp().globalData.apiUrl + "/api/v1/love";
					request(url, "DELETE", {
							pictureCollectionId: item.id,
						}, uni.getStorageSync("token"))
						.then(function(res) {
							console.log('返回正确回调', res)
							item.loved = false
							item.loveNum = item.loveNum - 1
						}, function(err) {
							console.log('返回错误回调', err)
						})
				} else {
					const url = getApp().globalData.apiUrl + "/api/v1/love";
					request(url, "POST", {
							pictureCollectionId: item.id,
						}, uni.getStorageSync("token"))
						.then(function(res) {
							console.log('返回正确回调', res)
							item.loved = true
							item.loveNum = item.loveNum + 1
						}, function(err) {
							console.log('返回错误回调', err)
						})
				}
			},
			userCenter(item) {
				uni.navigateTo({
					url: "/pages/PersonalCenter/UserCenter?id=" + item.id
				})
			},
			informationClick(item) {
				uni.navigateTo({
					url: "/pages/InformationDetail/InformationDetail?id=" + item.id
				})
			},
			changeGroup(num) {
				this.indexGroup = num;
				this.okDialog()
				this.page = 0;
				this.data = [];
				this.data1 = [];
				this.requstData()
			},
			search() {
				this.page = 0;
				this.data = [];
				this.data1 = [];
				this.requstData()

			},
			queryUser() {
				const that = this;
				const url = getApp().globalData.apiUrl + "/api/v1/user";
				request(url, "GET", {
						page: 0,
						type: 2
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调user', res)
						that.userList = res.data;
						that.userList1 = res.data;
					}, function(err) {
						console.log('返回错误回调', err)
					})
			},
			changeNext() {
				const that = this;
				const url = getApp().globalData.apiUrl + "/api/v1/user";
				request(url, "GET", {
						page: this.page1,
						type: 2
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调user', res)
						that.userList = res.data;
						that.page1++;
					}, function(err) {
						console.log('返回错误回调', err)
					})
			},

			clickOption(index) {
				this.tabIndex = index;
				this.page = 0;
				this.data = [];
				this.data1 = [];
				this.requstData();
			},
			changeCategory(num) {
				switch (num) {
					case 1:
						this.tabIndexCategory = num;
						break;
					case 2:
						this.tabIndexCategory = num;
						break;
					case 3:
						this.tabIndexCategory = num;
						break;
					default:
						this.tabIndexCategory = num;
						break;
				}
			},
			requstData() {
				const that = this;
				if (that.loading) {
					return
				}
				var label = '';
				var name = '';
				if (this.nameKey) {
					name = this.nameKey;
				}

				if (this.indexGroup > 0) {
					label = this.categoryList[this.indexGroup].id
				}
				that.loading = true;
				const url = getApp().globalData.apiUrl + "/api/v1/pictureCollection";
				request(url, "GET", {
						page: that.page,
						orderType: that.tabIndex,
						label: label,
						type: 1,
						name: name,
						queryType: 2
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调', res)
						that.page = that.page + 1;
						that.loading = false;
						var num = that.data.length + that.data1.length;
						if (res.data.length == 0)
							return
						for (var i = 0; i < res.data.length; i++) {
							var item = res.data[i]
							if (item.formatImages.length > 0) {
								if (num % 2 == 0) {
									that.data.push(item);
								} else {
									that.data1.push(item);
								}
								num++
							}
						}
						that.loading = false;
					}, function(err) {
						console.log('返回错误回调', err)
						that.loading = false;
					})
			},
			requstPostData() {
				const that = this;
				if (that.loading3) {
					return
				}
				that.loading3 = true;
				const url = getApp().globalData.apiUrl + "/api/v1/pictureCollection";
				request(url, "GET", {
						page: that.page3,
						orderType: that.tabIndex,
						type: 3,
						queryType: 2
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调post', res)
						that.page3 = that.page3 + 1;
						that.loading3 = false;
						if (res.data.length == 0)
							return
						for (var i = 0; i < res.data.length; i++) {
							that.list3.push(res.data[i]);
						}
						that.loading3 = false;
					}, function(err) {
						console.log('返回错误回调', err)
						that.loading3 = false;
					})
			},
			requstAdData() {
				const that = this;

				const url = getApp().globalData.apiUrl + "/api/v1/ad";
				request(url, "GET", {
						page: 0
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调post', res)
						if (res.data.length == 0)
							return
						for (var i = 0; i < res.data.length; i++) {
							that.adList.push(res.data[i]);
						}
						that.setH()

					}, function(err) {
						console.log('返回错误回调', err)

					})
			},
			requstInformationData() {
				const that = this;
				if (that.loading4) {
					return
				}
				that.loading4 = true;
				const url = getApp().globalData.apiUrl + "/api/v1/pictureCollection";
				request(url, "GET", {
						page: that.page4,
						type: 2,
						queryType: 2
					}, uni.getStorageSync("token"))
					.then(function(res) {
						console.log('返回正确回调', res)
						that.page4 = that.page4 + 1;
						that.loading4 = false;
						for (var i = 0; i < res.data.length; i++) {
							var item = res.data[i]
							that.informationList.push(item);
						}
						that.loading4 = false;
					}, function(err) {
						console.log('返回错误回调', err)
						that.loading4 = false;
					})
			}
		}
	}
</script>

<style>
	@import url("../../common/uni.css");

	.scroll-view_H {
		width: 100%;
		white-space: nowrap;
	}

	.bg-notice {
		background-color: #F0F0F0;
	}

	.scroll-view-item_H {
		display: inline-block;
		text-align: center;
	}

	.bgHead {
		padding: 3rpx;
		border-radius: 122rpx;
		box-sizing: border-box;
		background: linear-gradient(90deg, #0033FF 0%, #D000FF 100%);
	}

	.bgWhiteCircle {
		padding: 5rpx;
		background-color: white;
		border-radius: 116rpx;
	}

	.bgTab1 {
		min-height: 100vh;
		background: #F0F0F0;
	}
</style>